{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(123, 456, 789)\n"
     ]
    }
   ],
   "source": [
    "a = 123,456,789\n",
    "print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(5//2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "womn 3\n"
     ]
    }
   ],
   "source": [
    "print(\"womn\",3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "分钟数150\n",
      "2 : 30\n"
     ]
    }
   ],
   "source": [
    "a = int(input(\"分钟数\"))\n",
    "hour = a//60\n",
    "minute = a%60\n",
    "print(hour,\":\",minute)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "````\n",
    "from time import clock\n",
    "def timer(f):\n",
    "    def _f(*args):\n",
    "        t0 = clock()\n",
    "        f(*args)\n",
    "        return clock()-t0\n",
    "    return _f\n",
    "````"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from IPython.core.interactiveshell import InteractiveShell \n",
    "InteractiveShell.ast_node_interactivity = \"all\"\n",
    "from time import clock\n",
    "def timer(f):\n",
    "    def _f(*args):\n",
    "        t0 = clock()\n",
    "        f(*args)\n",
    "        return clock()-t0\n",
    "    return _f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.9753078532858126e-06"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99999\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "0.00014814808962171355"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99998\n"
     ]
    }
   ],
   "source": [
    "def delete_elem(x,index):\n",
    "    del x[index]\n",
    "    \n",
    "x = [5]*100000\n",
    "timer(delete_elem)(x,-1)\n",
    "print(len(x))\n",
    "timer(delete_elem)(x,0)\n",
    "print(len(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'12345aaffjklss'"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "''.join(sorted('faslkfjsa12345'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mon\n",
      "TUE\n",
      "WED\n"
     ]
    }
   ],
   "source": [
    "weekdays = ['mon','TUE','WED']\n",
    "for i in range(len(weekdays)):\n",
    "    print(weekdays[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mon\n",
      "WED\n"
     ]
    }
   ],
   "source": [
    "weekdays = ['mon','TUE','WED']\n",
    "for i in range(0,len(weekdays),2):\n",
    "    print(weekdays[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mon\n",
      "TUE\n",
      "WED\n"
     ]
    }
   ],
   "source": [
    "for i in weekdays:\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0   mon\n",
      "1   TUE\n",
      "2   WED\n"
     ]
    }
   ],
   "source": [
    "for key,day in enumerate(weekdays):\n",
    "    print(str(key)+\"   \"+day)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x\n",
      "xx\n",
      "xxx\n",
      "xxxx\n",
      "xxxxx\n"
     ]
    }
   ],
   "source": [
    "for i in range(5):\n",
    "    for j in range(i+1):\n",
    "        print(\"x\",end = \"\")\n",
    "    print(\"\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                nglaofeng           englaofen               \n",
      "            ofenglaofenglaofe   aofenglaofenglaof           \n",
      "          aofenglaofenglaofenglaofenglaofenglaofeng         \n",
      "         aofenglaofenglaofenglaofenglaofenglaofengla        \n",
      "        aofenglaofenglaofenglaofenglaofenglaofenglaof       \n",
      "        ofenglaofenglaofenglaofenglaofenglaofenglaofe       \n",
      "        fenglaofenglaofenglaofenglaofenglaofenglaofen       \n",
      "        englaofenglaofenglaofenglaofenglaofenglaofeng       \n",
      "        nglaofenglaofenglaofenglaofenglaofenglaofengl       \n",
      "        glaofenglaofenglaofenglaofenglaofenglaofengla       \n",
      "         aofenglaofenglaofenglaofenglaofenglaofengla        \n",
      "          fenglaofenglaofenglaofenglaofenglaofengla         \n",
      "          englaofenglaofenglaofenglaofenglaofenglao         \n",
      "            laofenglaofenglaofenglaofenglaofengla           \n",
      "             ofenglaofenglaofenglaofenglaofengla            \n",
      "              englaofenglaofenglaofenglaofengla             \n",
      "                laofenglaofenglaofenglaofengl               \n",
      "                  fenglaofenglaofenglaofeng                 \n",
      "                    glaofenglaofenglaofen                   \n",
      "                       fenglaofenglaof                      \n",
      "                          laofengla                         \n",
      "                             eng                            \n",
      "                              g                             \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n"
     ]
    }
   ],
   "source": [
    "print('\\n'.join([''.join([('fenglaoshi!'[(x-y)%7] if((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3<=0 else ' ') for x in range(-30,30)])for y in range(15,-15,-1)]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                veLoveLov           veLoveLov               \n",
      "            eLoveLoveLoveLove   eLoveLoveLoveLove           \n",
      "          veLoveLoveLoveLoveLoveLoveLoveLoveLoveLov         \n",
      "         veLoveLoveLoveLoveLoveLoveLoveLoveLoveLoveL        \n",
      "        veLoveLoveLoveLoveLoveLoveLoveLoveLoveLoveLov       \n",
      "        eLoveLoveLoveLoveLoveLoveLoveLoveLoveLoveLove       \n",
      "        LoveLoveLoveLoveLoveLoveLoveLoveLoveLoveLoveL       \n",
      "        oveLoveLoveLoveLoveLoveLoveLoveLoveLoveLoveLo       \n",
      "        veLoveLoveLoveLoveLoveLoveLoveLoveLoveLoveLov       \n",
      "        eLoveLoveLoveLoveLoveLoveLoveLoveLoveLoveLove       \n",
      "         oveLoveLoveLoveLoveLoveLoveLoveLoveLoveLove        \n",
      "          eLoveLoveLoveLoveLoveLoveLoveLoveLoveLove         \n",
      "          LoveLoveLoveLoveLoveLoveLoveLoveLoveLoveL         \n",
      "            eLoveLoveLoveLoveLoveLoveLoveLoveLove           \n",
      "             oveLoveLoveLoveLoveLoveLoveLoveLove            \n",
      "              eLoveLoveLoveLoveLoveLoveLoveLove             \n",
      "                veLoveLoveLoveLoveLoveLoveLov               \n",
      "                  oveLoveLoveLoveLoveLoveLo                 \n",
      "                    LoveLoveLoveLoveLoveL                   \n",
      "                       LoveLoveLoveLov                      \n",
      "                          LoveLoveL                         \n",
      "                             Lov                            \n",
      "                              v                             \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n",
      "                                                            \n"
     ]
    }
   ],
   "source": [
    "print('\\n'.join([''.join([('Love'[(x-y) % len('Love')] if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 <= 0 else ' ') for x in range(-30, 30)]) for y in range(30, -30, -1)]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<function __main__.exp_factory.<locals>.exp>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "function"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.core.interactiveshell import InteractiveShell \n",
    "InteractiveShell.ast_node_interactivity = \"all\"\n",
    "def exp_factory(n):\n",
    "    def exp(a):\n",
    "        print(a)\n",
    "        return a**n\n",
    "    return exp\n",
    "\n",
    "square = exp_factory(2)\n",
    "square\n",
    "type(square)\n",
    "square(4)\n",
    "exp_factory(2)(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "double = lambda x:x*2\n",
    "double(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'a': 1, 'b': 2, 'c': 3}\n",
      "(1, 2, 3)\n"
     ]
    }
   ],
   "source": [
    "double = lambda **x:print(x)\n",
    "double(a=1,b=2,c=3)\n",
    "\n",
    "double = lambda *x:print(x)\n",
    "double(1,2,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "19"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    " def find_max(l):\n",
    "    import time\n",
    "    start = time.time()\n",
    "    \n",
    "    if l == None:\n",
    "        return None\n",
    "    mx = l[0]\n",
    "    for n in l:\n",
    "        if n>mx:\n",
    "            mx =n\n",
    "            \n",
    "    t =time.time() - start\n",
    "    return mx,len(l),t\n",
    "\n",
    "import random\n",
    "random_lists=[[int(1000*random.random()) for i in range(10000*n)] for n in range(1,20)]\n",
    "rst = [find_max(l) for l in random_lists]\n",
    "len(rst)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1bb6918ecc0>]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VOW9x/HPj7DvW1gMhACyKShLIIhLtS4sVrG2VcQF\nFKW2Yuut1qX2WlrreqXWnaKgYFG0tl6ooAIqCCqQIKBAyMIeDFlYkkBIyPLcP3KwIRfIAMmcmeT7\nfr3mlZnnPGfym5PlO+c85zxjzjlERETq+F2AiIiEBgWCiIgACgQREfEoEEREBFAgiIiIR4EgIiKA\nAkFERDwKBBERARQIIiLiqet3ASejbdu2LiYmxu8yRETCyurVq7Odc5GV9QurQIiJiSEhIcHvMkRE\nwoqZbQ+knw4ZiYgIoEAQERGPAkFERAAFgoiIeBQIIiICKBBERMSjQBAREUCBICIS0jLzCvjjvzeQ\nW1BU7d8rrC5MExGpLQqKSpi+fCsvf5ZKYXEp53dvy2Vnta/W76lAEBEJIaWljnnrvuPpjzbxXU4B\nV5zVngdH9qZbZNNq/94KBBGREBG/bS9//mAj69JyOPuM5ky5rj/ndW8TtO+vQBAR8dmOPfk8+VEi\nC77dTfvmDXjmZ+dy7YAo6tSxoNahQBAR8UnOoSJe+iyVN77YRkQd478u68kdF3WlcX1//jUrEERE\ngqyopJS3V+3g2UXJ7D9UxE8HduK+4b1o37yhr3UpEEREgsQ5x2dJmTw2P5HNWQc5r1sbHr6yD32j\nWvhdGqBAEBEJisT0XB6bn8jy1Gy6tW3Cq7fEclmfdpgFd5zgRBQIIiLVKDO3gCkLk3l39U5aNKrH\n5KvO4sahXagXEXrXBSsQRESqQf7hYl5btpWpSzdTVFLKhPO7cvcPe9CicT2/SzsuBYKISBUqKXX8\nc3UaUxYlkZFbyMi+HXhgRG9i2jbxu7RKKRBERKrI58lZPL4gkU278xgQ3ZKXbxzIoC6t/S4rYAoE\nEZHTlJi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DKO+SQa2ZDvee8BZhbbp0jZxb8FPj0yB/y\nSdbaxMyaHblP2QDj+grPP67C9/WlVs9R77pCcZse47mqa/t9DFxhZq28wydXeG0nxcxGAPcDVzvn\n8su1R5pZhHe/m1frFr9qDdLPukq2KXAZsMk59/2hoFDbntXmdEela9oNuICyQwTfAGu92yjgTeBb\nr30e0LHcOg9T9o4hCe8MA689lrJf/M3Ai/znQsCGlB02SaXsDIVup1hrN8rO0FgHbAAe9trbAJ8A\nKcBioHUI1NqEsndHLcq1+b5NKQuodKCIsmO5E4K1/Sg75p/q3W49xVpTKTsefeR39chZLT/xfifW\nAl8DVwWr1uPUGZSf9enW6bW/AdxZoa9v2zOYN12pLCIigA4ZiYiIR4EgIiKAAkFERDwKBBERARQI\nIiLiUSCIiAigQBAREY8CQUREAPg/WnN6ElosrfUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1bb64f38e48>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "\n",
    "x = list(zip(*rst))[1]\n",
    "y = list(zip(*rst))[2]\n",
    "plt.plot(x,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Zen of Python, by Tim Peters\n",
      "\n",
      "Beautiful is better than ugly.\n",
      "Explicit is better than implicit.\n",
      "Simple is better than complex.\n",
      "Complex is better than complicated.\n",
      "Flat is better than nested.\n",
      "Sparse is better than dense.\n",
      "Readability counts.\n",
      "Special cases aren't special enough to break the rules.\n",
      "Although practicality beats purity.\n",
      "Errors should never pass silently.\n",
      "Unless explicitly silenced.\n",
      "In the face of ambiguity, refuse the temptation to guess.\n",
      "There should be one-- and preferably only one --obvious way to do it.\n",
      "Although that way may not be obvious at first unless you're Dutch.\n",
      "Now is better than never.\n",
      "Although never is often better than *right* now.\n",
      "If the implementation is hard to explain, it's a bad idea.\n",
      "If the implementation is easy to explain, it may be a good idea.\n",
      "Namespaces are one honking great idea -- let's do more of those!\n"
     ]
    }
   ],
   "source": [
    "import this"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import win32com.client\n",
    "spk  = win32com.client.Dispatch(\"SAPI.SpVoice\")\n",
    "spk.Speak(u\"天天向上，好好学习哦\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A -> B\n",
      "A -> C\n",
      "B -> C\n",
      "A -> B\n",
      "C -> A\n",
      "C -> B\n",
      "A -> B\n"
     ]
    }
   ],
   "source": [
    "#汉诺塔\n",
    "def hanoi(n,a,b,c):\n",
    "    if n == 1:\n",
    "        print(a,\"->\",b)\n",
    "    else:\n",
    "        hanoi(n-1,a,c,b)\n",
    "        hanoi(1,a,b,c)\n",
    "        hanoi(n-1,c,b,a)\n",
    "        \n",
    "hanoi(3,\"A\",\"B\",\"C\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "```\n",
    "class LinkedList():\n",
    "    def _init_(self, lst=None): \n",
    "        self.head = None \n",
    "        if lst != None: \n",
    "            for val in lst: \n",
    "                self, add(val)\n",
    "    def add (self, val):\n",
    "        self.head = Node(val, self.head)\n",
    "    def isEmpty(self):\n",
    "        return self.head = None\n",
    "\n",
    "    def _str_(self): \n",
    "        p = self.head \n",
    "        s ='->’\n",
    "        while p != None:\n",
    "            s +=str(p.val)+'->'\n",
    "            p = p. next\n",
    "        s +='None' \n",
    "        return s\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11],\n",
       "       [ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12],\n",
       "       [ 2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13],\n",
       "       [ 3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14],\n",
       "       [ 4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15],\n",
       "       [ 5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16],\n",
       "       [ 6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17],\n",
       "       [ 7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18],\n",
       "       [ 8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],\n",
       "       [ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],\n",
       "       [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],\n",
       "       [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "def f(x,y):\n",
    "    return x+y\n",
    "\n",
    "b=np.fromfunction(f,(12,12),dtype =int)\n",
    "b"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Raw Cell Format",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
